import axios from "axios";
import {Dialog} from "@varlet/ui";

const request = axios.create({
    baseURL: 'http://wldd.xyz:8081',
    timeout: 8000,
})

request.interceptors.response.use(
    response => {
        const res = response.data;
        if (res.code != 200) {
            Dialog(res.msg);
        } else {
            return res;
        }
    },
    error => {
        return Promise.reject(error);
    }
)

export default request;